package client.controller

import org.springframework.beans.factory.annotation.Value
import org.springframework.cloud.context.config.annotation.RefreshScope
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController

@RestController
/*
使用@RefreshScope注解的Bean将会在访问/actuator/refresh端点后被重新创建
 */
@RefreshScope
class MyController {

    /*
    本地并没有name属性,这里从git上拉取yml配置文件并获取值
     */
    @Value('${name}')
    String name

    @GetMapping
    String get(){
        name
    }

}

